package com.ctshk.sapp.order.tour.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.order.tour.dto.SeriesOrderTouristQuitNoticeDetailDTO;
import com.ctshk.rpc.order.tour.req.SeriesOrderTouristQuitNoticeDetailReq;
import com.ctshk.rpc.order.tour.service.ISeriesOrderTouristQuitNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 退团通知书 前端控制器
 * </p>
 *
 * @author 谭响
 * @since 2021-02-04
 */
@Api(value="退团通知书", tags="退团通知书")
@RestController
@RequestMapping("/series/order/tourist/quit/notice")
public class SeriesOrderTouristQuitNoticeController extends BaseController {

    @DubboReference
    private ISeriesOrderTouristQuitNoticeService iSeriesOrderTouristQuitNoticeService;

    @ApiOperation(value = "详情", notes = "详情（退團管理-退團通知書）")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "退團管理-退團通知書", operDesc = "退團管理-退團通知書")
    @PostMapping("/detail")
    public Result<SeriesOrderTouristQuitNoticeDetailDTO> detail(@RequestBody @Valid SeriesOrderTouristQuitNoticeDetailReq req) {
        req.setUserId(getCurrentUser(getRequest()).getId());
        return iSeriesOrderTouristQuitNoticeService.detail(req);
    }

}
